//
//  RootControlelrManager.m
//  test
//
//  Created by kepuG on 17/1/20.
//  Copyright © 2017年 text. All rights reserved.
//

#import "RootControlelrManager.h"
#import "FirstViewController.h"
#import "SecondViewController.h"
#import "BasicNavigationController.h"
#import "MineViewController.h"
#import "RKSwipeBetweenViewControllers.h"
#import "RKSwipeBetweenViewControllers.h"

@implementation RootControlelrManager

+(RootControlelrManager*)manager{
    RootControlelrManager *manager = [[RootControlelrManager alloc] init];
    return manager;
}

-(NSArray*)controllers{
    
    NSArray *contrs = @[@"MineViewController",@"MessageViewController",
                        @"BubblingViewController",@"SecondViewController",
                        @"FirstViewController"];
    
    NSArray *titleName = @[@"我",@"消息",@"冒泡",@"任务",@"项目"];
    
    NSMutableArray *controllers = [[NSMutableArray alloc] init];
    
    for (int i = 0 ;i < contrs.count ; i++) {
        
        Class vc = NSClassFromString([contrs objectAtIndex:i]);
        UIViewController *normalVC = [[vc alloc]  init];;
        normalVC.title = [titleName objectAtIndex:i];
        
        BasicNavigationController *nav1 = nil;
        
        if ([[titleName objectAtIndex:i] isEqualToString:@"冒泡"]) {
            
            
           // nav1 = [[RKSwipeBetweenViewControllers alloc] initWithRootViewController:normalVC];
            
            nav1 = [RKSwipeBetweenViewControllers newSwipeBetweenViewControllers];
            
        }else{
            nav1 = [[BasicNavigationController alloc] initWithRootViewController:normalVC];
        }
        
        
        NSDictionary *textAttributes = @{
                                         NSFontAttributeName: [UIFont systemFontOfSize:kNavTitleFontSize],
                                         NSForegroundColorAttributeName: kColorNavTitle,
                                         };
        [nav1.navigationBar setTitleTextAttributes:textAttributes];
        
        [nav1.navigationBar setTintColor:kColorBrandGreen];//返回按钮的箭头颜色
        
        [controllers addObject:nav1];
    }
    
    return controllers;
}

@end
